<%@ page language="java" contentType="text/xml; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="java.io.*,javax.xml.parsers.*,org.w3c.dom.*" %>

<%
	/*
	 StringBuffer xml=new StringBuffer();
	 String line=null;
	 BufferedReader read=request.getReader();
	 while((line=read.readLine())!=null){
	 xml.append(line);
	 }
	 */
	try {
		DocumentBuilderFactory factory = DocumentBuilderFactory
				.newInstance();
		DocumentBuilder builder = factory.newDocumentBuilder();
		Document document = builder.parse(request.getInputStream());
		Node n = document.getElementsByTagName("type").item(0);
		if (n.getTextContent().equals("loadNotes")) {
%>
		<response>
	    <status>OK</status>
	    <notes>
	        <note>
	            <id>11</id>
	            <text>how are you?</text>
	            <timestamp>12412541235</timestamp>
	            <left>270px</left>
	            <top>300px</top>
	            <zindex>10000</zindex>
	            <url>http://www.baidu.com/</url>
	        </note>
	        <note>
	            <id>22</id>
	            <text>how are you?</text>
	            <timestamp>12412541235</timestamp>
	            <left>570px</left>
	            <top>600px</top>
	            <zindex>10000</zindex>
	            <url>http://www.baidu.com/</url>
	        </note>
	    </notes>
	</response>
	<%
		} else if (n.getTextContent().equals("addNotes")) {
	%>
		<response>
	    <status>OK</status>
	</response>
		<%
			} else if (n.getTextContent().equals("updateNotes")) {
		%>
		<response>
	    <status>OK</status>
	</response>
<%
	} else if (n.getTextContent().equals("removeNotes")) {
%>
<response>
	    <status>OK</status>
	</response>
		<%
			}
			} catch (Exception ex) {
				out.println(ex.getMessage());
			}
			//out.println("AAAAA:");
			//out.println(xml);
		%>